import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    //任务列表的选中索引状态
    taskListActive: 0,
    taskSearch: '', //存放任务搜索的关键字
    tabberActive: '', //当前底部导航栏的选中状态
    isShowFoot: true, //是否显示底部栏
  },
  //更改状态的对象
  mutations: {
    updateTaskListActive(state, val) {
      state.taskListActive = val;
    },
    updateTaskSearch(state, val) {
      state.taskSearch = val
    },
    updatetTabberActive(state, val) {
      state.tabberActive = val
    },
    updateShowFoot(state, val){
      state.isShowFoot = val
    }
  }
})

export default store;
